<?php
session_start();//开启session
?>
<!DOCTYPE html>
<html>
    <head>
        <title>角色列表</title>
        <meta charset="utf-8" />
        <link type="text/css" rel="stylesheet" href="../bootstrap/css/bootstrap.min.css" />
        <script type="text/javascript" src="../bootstrap/js/jquery-1.9.1.min.js"></script>
        <script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script>
        <style type="text/css">
        .form-group{line-height: 35px;}
        </style>
        <script type="text/javascript">
        $(function(){
            //加载所有角色
            $.getJSON("../index.php?c=Permision&a=loadAllRole",function(data){
                for(var i=0;i<data.length;i++){
                    $("#roleData").append("<tr>"+
                            "<td>"+data[i].rid+"</td>"+
                            "<td>"+data[i].roleName+"</td>"+
                            "<td><a href='editUserRole.php?rid="+data[i].rid+"' class='btn btn-primary btn-xs'>编辑用户角色</a>&nbsp;"+
                            "<a href='' class='btn btn-danger btn-xs'>编辑角色权限</a></td></tr>");
                }
            });
        });

        </script>
    </head>
    <body>
        <table class="table table-bordered table-striped table-hover">
            <thead>
                <tr>
                    <th>角色编号</th>
                    <th>角色名称</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody id="roleData"></tbody>
        </table>
    </body>
</html>